#ifndef _GPIO_H
#define _GPIO_H

#ifdef __cplusplus
 extern "C" {
#endif 

/* Includes ------------------------------------------------------------------*/
#include "stm32f10x.h"
#include "main.h"

typedef enum 
{  
	BUTTON_WAKEUP = 0,
	BUTTON_TAMPER = 1
} Button_TypeDef;

typedef enum 
{  
	BUTTON_MODE_GPIO = 0,
	BUTTON_MODE_EXTI = 1
} ButtonMode_TypeDef;

#define Button_WAKEUP       BUTTON_WAKEUP
#define Button_TAMPER        BUTTON_TAMPER
#define Mode_GPIO            BUTTON_MODE_GPIO
#define Mode_EXTI            BUTTON_MODE_EXTI
#define Button_Mode_TypeDef  ButtonMode_TypeDef

	/********************************/


/**
  * @}
  */
  
/** @addtogroup STM32F103C8T6_GPS_LOW_LEVEL_BUTTON
  * @{
  */  
#define BUTTONn                          2

/**
 * @brief Wakeup push-button
 */
#define WAKEUP_BUTTON_PIN               			 GPIO_Pin_0
#define WAKEUP_BUTTON_GPIO_PORT        		 GPIOA
#define WAKEUP_BUTTON_GPIO_CLK            		 RCC_APB2Periph_GPIOA
#define WAKEUP_BUTTON_EXTI_LINE          		 EXTI_Line0
#define WAKEUP_BUTTON_EXTI_PORT_SOURCE   	GPIO_PortSourceGPIOA
#define WAKEUP_BUTTON_EXTI_PIN_SOURCE    	GPIO_PinSource0
#define WAKEUP_BUTTON_EXTI_IRQn          		EXTI0_IRQn 
/**
 * @brief Tamper push-button
 */
#define TAMPER_BUTTON_PIN                			GPIO_Pin_13
#define TAMPER_BUTTON_GPIO_PORT      			GPIOC
#define TAMPER_BUTTON_GPIO_CLK          			RCC_APB2Periph_GPIOC
#define TAMPER_BUTTON_EXTI_LINE         			EXTI_Line13
#define TAMPER_BUTTON_EXTI_PORT_SOURCE   	GPIO_PortSourceGPIOC
#define TAMPER_BUTTON_EXTI_PIN_SOURCE    		GPIO_PinSource13
#define TAMPER_BUTTON_EXTI_IRQn          		EXTI15_10_IRQn 

void STM_EVAL_PBInit(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode);
uint32_t STM_EVAL_PBGetState(Button_TypeDef Button);


#endif


